<template>

	<u-tabbar :value="tabber" @change="onChange" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true"
		:border="false" activeColor="#5BB87E">
		<u-tabbar-item v-for="(item,index) in tabBarList" :key="item.url" :text="item.text">
			<image class="u-page__item__slot-icon" slot="inactive-icon" :src="item.iconPath"></image>
			<image class="u-page__item__slot-icon" slot="active-icon" :src="item.selectedIconPath"></image>
		</u-tabbar-item>
	</u-tabbar>
</template>

<script>

	export default {
		name: "base-tab-bar",
		props: {
			tabber: {
				type: Number,
				default: 0,
				required: true
			}
		},
		data() {
			return {
				tabBarList: [
					
				],
			};
		},
		async created() {
			const type = getApp().globalData.type
			if(type == 'visitor'){
				this.tabBarList = this.$settings.tabBarList
			}else if(type == 'company'){
				this.tabBarList = this.$settings.tabBarList2
			}else{
				this.tabBarList = this.$settings.tabBarList
			}

		},
		computed:{
			
		},
		methods: {
			
			onChange(index) {
				console.log(this.tabBarList,index)// 测试用 误删
				const url = this.tabBarList[index].url
		
				uni.switchTab({
					url: url,
				})
			},

		},

	}
</script>

<style lang="less">
	.u-page__item__slot-icon {
		width: 50rpx;
		height: 50rpx
	}
</style>
